﻿using System.Collections.Generic;
using Model;
using DBUtility;

/*
 * 作者:陈杰
 * QQ  :710782046
 * Email:ovenjackchain@gmail.com
 * Web :http://www.qidian10.com
 */
namespace DAO
{
    public class d00_zjs_jdblDao
    {
        /// <summary>
        /// 获得所有记录
        /// </summary>
        /// <returns>返回所有记录IList</returns>
        public IList<d00_zjs_jdbl> FindAll_d00_zjs_jdbl()
        {
            return Common<d00_zjs_jdbl>.Dt2List(DbHelperSQL.FindByConditions(new d00_zjs_jdbl(), ""));
        }
        /// <summary>
        /// 分页获取数据
        /// </summary>
        /// <param name="start">起始记录号</param>
        /// <param name="limit">每页记录数</param>
        /// <param name="conditions">查询条件</param>
        /// <returns>返回符合记录的当前页数据</returns>
        public IList<d00_zjs_jdbl> FindAllByPage_d00_zjs_jdbl(string start, string limit, string conditions)
        {
            return Common<d00_zjs_jdbl>.Dt2List(DbHelperSQL.FindByPage(new d00_zjs_jdbl(), start, limit, conditions));
        }

        /// <summary>
        /// 查找符合条件记录的总条数
        /// </summary>
        /// <param name="conditions">查询条件</param>
        /// <returns>返回符合的记录条数</returns>
        public string GetCount_d00_zjs_jdbl(string conditions)
        {
            return DbHelperSQL.GetCountByConditions(new d00_zjs_jdbl(), conditions);
        }

        /// <summary>
        /// 根据id查找相应的一条记录
        /// </summary>
        /// <param name="id">要查找的ID号</param>
        /// <returns>返回值</returns>
        public d00_zjs_jdbl FindById_d00_zjs_jdbl(int id)
        {
            d00_zjs_jdbl model = new d00_zjs_jdbl();
            return Common<d00_zjs_jdbl>.Dt2Model(model, DbHelperSQL.FindByConditions(model, " " + Common<object>.GetModelInfo(model)[1] + "=" + id.ToString()));
        }

        /// <summary>
        /// 添加新纪录
        /// </summary>
        /// <param name="d00_zjs_jdbl">实体</param>
        /// <returns>返回是否成功</returns>
        public bool Add_d00_zjs_jdbl(d00_zjs_jdbl _d00_zjs_jdbl)
        {
                return DbHelperSQL.Insert(_d00_zjs_jdbl);
        }

        /// <summary>
        /// 更新对象
        /// </summary>
        /// <param name="d00_zjs_jdbl">实体</param>
        /// <returns>返回是否成功</returns>
        public bool Update_d00_zjs_jdbl(d00_zjs_jdbl _d00_zjs_jdbl)
        {
                return DbHelperSQL.Update(_d00_zjs_jdbl);
        }
        //批量更新
        public bool Update_d00_zjs_jdbl(string sets,string conditions)
        {
                return DbHelperSQL.Update(new d00_zjs_jdbl(),sets,conditions);
        }
        /// <summary>
        /// 删除记录
        /// </summary>
        /// <param name="d00_zjs_jdbl">实体</param>
        /// <returns>返回是否成功</returns>
        public bool Del_d00_zjs_jdbl(d00_zjs_jdbl _d00_zjs_jdbl)
        {
                return DbHelperSQL.Delete(_d00_zjs_jdbl);
        }
        //批量删除
        public bool Del_d00_zjs_jdbl(string conditions)
        {
                return DbHelperSQL.Delete(new d00_zjs_jdbl(),conditions);
        }
        /// <summary>
        /// 根据条件查询记录
        /// </summary>
        /// <param name="conditions">条件</param>
        /// <returns>返回符合条件的IList</returns>
        public IList<d00_zjs_jdbl> FindByCondition_d00_zjs_jdbl(string conditions)
        {
            return Common<d00_zjs_jdbl>.Dt2List(DbHelperSQL.FindByConditions(new d00_zjs_jdbl(), conditions));
        }
    }
}
